package com.lzj.server.constant.enums;

/**
 * @author Lzj
 * @date 2025/5/10
 * @description 响应状态枚举类
 */
public enum ResultCodeEnum {

    SUCCESS(200, "操作成功"),
    FAIL(400, "操作失败"),
    VALIDATE_ERROR(422, "参数校验失败"),
    UNAUTHORIZED(401, "未认证"),
    FORBIDDEN(403, "无权限访问"),
    NOT_FOUND(404, "资源未找到"),
    SERVER_ERROR(500, "服务器内部错误"),
    EMAIL_REGISTERED(400, "该邮箱已被注册"),
    EMAIL_OR_PASSWORD_EMPTY(400, "邮箱或密码不能为空"),
    ACCOUNT_NOT_EXIST(400, "账号不存在"),
    EMAIL_CODE_ERROR(400, "验证码错误"),
    ACCOUNT_PASSWORD_ERROR(400, "账号或密码错误"),
    USERNAME_EXIST(400, "用户名已存在");


    private final int code;
    private final String message;

    ResultCodeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int code() {
        return code;
    }

    public String message() {
        return message;
    }
}
